home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February (DVD) / PCWorld_2008-02_DVD.iso / v cisle / PHP / PHP.exe / EasyPHP-2.0b1-setup.exe / {app} / sqlitemanager / include / dbproperties.php < prev    next >
Encoding:
PHP Script  |  2006-04-18  |  4.9 KB  |  81 lines

  1. <?php
  2. /**
  3. * Web based SQLite management
  4. * Show and manage database properties
  5. * @package SQLiteManager
  6. * @author FrΘdΘric HENNINOT
  7. * @version $Id: dbproperties.php,v 1.24 2006/04/14 15:16:52 freddy78 Exp $ $Revision: 1.24 $
  8. */
  9.  
  10. foreach($dbItems as $item){
  11. ?>
  12. <center>
  13. <table width="80%"><tr><td align="center">
  14. <fieldset><legend><?php echo $itemTranslated[$item] ?></legend>
  15. <?php
  16.     $listItem = $workDb->getPropList($item);
  17.     if($listItem){
  18.         echo '<table width="90%" cellpadding="2" cellspacing="0" class="Browse">';
  19.         if( $item == 'Table' ) $colspan = 5;
  20.         elseif($item == 'View') $colspan = 3;
  21.         elseif(($item == 'Function') || ($item == 'Trigger')) $colspan=2;
  22.         echo '    <thead><tr>
  23.                     <td align="center" class="tabproptitle">'.$itemTranslated[$item].'</td>
  24.                     <td align="center" colspan="'.$colspan.'" class="tabproptitle">'.$traduct->get(33).'</td>'."\n";
  25.         if( ($item == 'Table') || ($item=='View') ) echo '        <td align="center" class="tabproptitle" style="white-space: nowrap">'.$traduct->get(118).'</td>'."\n";
  26.         echo '    </tr></thead>';
  27.         $totItem = $totEnr = 0;
  28.         foreach($workDb->getPropList($item) as $itemName){
  29.             if($totItem % 2) $localBgColor = $GLOBALS['browseColor1'];
  30.             else $localBgColor = $GLOBALS['browseColor2'];
  31.             
  32.             $totItem++;
  33.             $linkBase = 'main.php?dbsel='.$GLOBALS['dbsel'].'&'.strtolower($item).'='.$itemName;
  34.             if( ($item == 'Table') || ($item=='View') ){
  35.                 if($workDb->getResId('SELECT count(*) FROM '.brackets($itemName))) $nbEnr = $workDb->connId->fetch_single();
  36.                 else $nbEnr = ' ';
  37.                 $totEnr+=$nbEnr;
  38.             }
  39.             echo "\t<tr bgcolor='".$localBgColor."' onMouseOver=\"setRowColor(this, $totItem, 'over', '".$localBgColor."', '".$GLOBALS['browseColorOver']."', '".$GLOBALS["browseColorClick"]."')\" 
  40.                                     onMouseOut=\"setRowColor(this, $totItem, 'out', '".$localBgColor."', '".$GLOBALS["browseColorOver"]."', '".$GLOBALS['browseColorClick']."')\">\n";
  41.             echo "        <td class=\"tabprop\" align='left'><a href=\"".$linkBase."\" class=\"PropItemTitle\"><span style=\"font-size: 12px\"> ".$itemName."</span></a></td>\n";
  42.             if(isset($nbEnr) && $nbEnr && ( ($item == 'Table') || ($item=='View') )) echo "        <td class=\"tabprop\" align='center'><a href=\"".$linkBase."&action=browseItem\" class=\"propItem\">".displayPics("browse2.png", $traduct->get(73))."</a></td>\n";
  43.             elseif( ($item == 'Table') || ($item=='View') ) echo "        <td class=\"tabprop\" align='center'><span style='color: gray'>".displayPics("browse_off.png", $traduct->get(73))."</span></td>\n";
  44.             if(($item == 'Table')) {
  45.                 if(!$workDb->isReadOnly() && displayCondition("data")) echo "        <td class=\"tabprop\" align='center'><a href=\"".$linkBase."&action=insertElement\" class=\"propItem\">".displayPics("insertrow.png", $traduct->get(119))."</a></td>\n";
  46.                 else echo "        <td class=\"tabprop\" align='center'><i>".displayPics("insertrow_off.png", $traduct->get(119))."</i></td>\n";
  47.             }
  48.             echo "        <td class=\"tabprop\" align='center'><a href=\"".$linkBase."\" class=\"propItem\">".displayPics("properties.png", $traduct->get(61))."</a></td>\n";
  49.             if(!$workDb->isReadOnly() && displayCondition("del")) {
  50.                 $stringConf = $traduct->get(120)." ".(($item!="Trigger")? $traduct->get(122) : $traduct->get(121) )." ".$itemTranslated[$item]." ".$itemName."?";
  51.                 echo "        <td class=\"tabprop\" align='center'><a href=\"#\" onClick=\"javascript:if(confirm('".$stringConf."')) parent.main.location='".$linkBase."&action=delete';\" class=\"propItem\">".displayPics("delete_table.png", $traduct->get(86))."</a></td>\n";            
  52.             } else {
  53.                 echo "        <td class=\"tabprop\" align='center'><i>".displayPics("delete_table_off.png", $traduct->get(86))."</i></td>\n";            
  54.             }
  55.             if(isset($nbEnr) && $nbEnr && ( $item=="Table" )) {
  56.                 if(!$workDb->isReadOnly() && displayCondition("empty")) echo "        <td class=\"tabprop\" align='center'><a href=\"#\" onClick=\"javascript:if(confirm('".$traduct->get(123)." ".$itemName."?')) parent.main.location='".$linkBase."&action=empty';\" class=\"propItem\">".displayPics("edittrash.png", $traduct->get(77))."</a></td>\n";
  57.                 else echo "        <td class=\"tabprop\" align='center'><i>".displayPics("edittrash_off.png", $traduct->get(77))."</i></td>\n";
  58.             } elseif( $item=="Table" ) echo "        <td class=\"tabprop\" align='center'><span style='color: gray'>".displayPics("edittrash_off.png", $traduct->get(77))."</span></td>\n";
  59.             if( ($item == 'Table') || ($item=='View') ) echo '        <td class="tabprop" align="center">'.$nbEnr.'</td>
  60.                     </tr>';
  61.         }
  62.         echo '    <tr>
  63.                     <td align="center" class="tabproptitle" style="white-space: nowrap">'.$totItem.' '.$itemTranslated[$item].$traduct->get(228).'</td>
  64.                     <td colspan="'.$colspan.'" class="tabproptitle"> </td>'."\n";
  65.         if( ($item == 'Table') || ($item=='View') ) echo '        <td align="center" class="tabproptitle">'.$totEnr.'</td>'."\n";
  66.         echo ' </tr>';
  67.         echo '</table>';
  68.     } else {
  69.         echo ' ';
  70.     }
  71.     if(!$workDb->isReadOnly() && displayCondition('properties')) formAddItem($item);
  72. ?>
  73. </fieldset>
  74. </td></tr></table>
  75. </center>
  76. <?php
  77. }
  78. ?>
  79. </body>
  80. </html>
  81.